package com.yjd.msg.comm.core.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.msg.comm.core.dao.IMsgDisposeDao;
import com.yjd.msg.comm.model.MsgDisposeModel;
import com.yjd.msg.comm.service.IMsgDisposeService;


/**
 * <b>description</b>：消息处理表业务实现<br>
 * <b>time</b>：2018-01-19 11:55:50 <br>
 * <b>author</b>：  carl
 */
public class MsgDisposeServiceImpl extends BaseServiceImpl implements IMsgDisposeService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MsgDisposeModel insert(MsgDisposeModel model) throws Exception {
		return this.msgDisposeDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MsgDisposeModel model) throws Exception {
		return this.msgDisposeDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.msgDisposeDao.deleteModel(paramMap, true);
	}

	@Resource
	private IMsgDisposeDao msgDisposeDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.msgDisposeDao;
	}

}
